package com.yutian.selfservice.search.controller;

import com.yutian.selfservice.support.ListService;
import com.yutian.selfservice.search.service.SearchService;
import com.yutian.selfservice.support.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.constraints.NotNull;


@Controller
@RequestMapping("/search")
public class ServiceController {
    @Autowired
    private SearchService searchService;

    @RequestMapping("/list")
    @ResponseBody
    public Result search(@RequestBody @Validated ListService listService){
        return searchService.search(listService);
    }
    @RequestMapping("/details")
    @ResponseBody
    public Result details(@RequestBody @Validated ListService listService){
        return searchService.details(listService);
    }
}
